package com.verify.util;

import cn.hutool.core.util.StrUtil;
import com.verify.func.MsgFunction;
import com.verify.func.ValidationHandingFunction;

public class VerifyUtil {
    public static void isEmpty(String s, MsgFunction msg, ValidationHandingFunction func) {
        if (StrUtil.isEmpty(s)) {
            func.function(msg.function());
        }
    }

    public static void operation(boolean verity, MsgFunction msg, ValidationHandingFunction func) {
        if (verity) {
            func.function(msg.function());
        }
    }

    public static void verify(boolean verity, MsgFunction msg, ValidationHandingFunction func) {
        if (verity) {
            func.function(msg.function());
        }
    }
}
